<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
  <title>{{session("szyLy.title")}} </title>
  <meta name="keywords" content={{session("szyLy.keywords")}} />
    <meta name="description" content={{session("szyLy.description")}} />
	<link rel="shortcut icon" href="/style/home/img/1.png">
	<link rel="stylesheet" href="/style/home/css/zhufu.css">
	<script src="/style/home/js/jquery.js"></script>

	<script src="/style/home/js/zhifu.js"></script>

     <script src="/style/home/js/area2.js"></script>
</head>
<body>
    @include("home.public.header1")

<div class="top_logob">
     <a href="/"><img src="/style/home/img/pic-15.jpg" class="top_logob_imga"></a>
    <img src="/style/home/img/pic-16.jpg" class="top_logob_imgb">
</div>
<form action="/orders" method="post" id="fors">
    {{csrf_field()}}
<div class="wrap" style="padding-top: 40px;">
<div class="box-01">
    <div class="box-tl">
        <p>请填写并核对以下信息</p>
    </div>

    <div class="box-a" id="box-a">
    	<p>收货信息：<span class="showbtn-SH showbtn new_p" >
            <span onclick="opens()" style="cursor:pointer;">＋新增收货地址</span>
        </p>

        <div id="addressList-SH">
          @if(!empty($uaddr))
           <p>
              <input type="radio" checked name="aid" class="aid" value="{{$defadd['id']}}">
                    <span>{{$defadd['sname']}}</span>
                    <span>{{$defadd['stel']}}</span>
                    <span>{{$defadd['addr']}}</span>
                    <span>{{$defadd['addrInfo']}}</span>
                    <span>{{$defadd['email']}}</span>
            </p>
               @foreach($uaddr as $aaa)
                <p>
                   <input type="radio"  name="aid" class="aid" value="{{$aaa['id']}}">
                    <span>{{$aaa['sname']}}</span>
                    <span>{{$aaa['stel']}}</span>
                    <span>{{$aaa['addr']}}</span>
                    <span>{{$aaa['addrInfo']}}</span>
                    <span>{{$aaa['email']}}</span>
                </p>

            @endforeach

            @else
              @foreach($addr as $dizhi)
                <p>
                    <input type="radio" checked name="aid" class="aid" value="{{$dizhi['id']}}">
                    <span>{{$dizhi['sname']}}</span>
                    <span>{{$dizhi['stel']}}</span>
                    <span>{{$dizhi['addr']}}</span>
                    <span>{{$dizhi['addrInfo']}}</span>
                    <span>{{$dizhi['email']}}</span>
                </p>

            @endforeach
            @endif
        </div>

        <div id="bg-SH" class="bg-n"></div>
    </div>


            <div class="box-b" id="box-b">
            	<p>支付方式：</p>
            <div style="cursor:pointer;" class="box-ax bgse pink"  id="bgdiv0" value="0">
                    <p>
                    	<span>在线支付</span>
                     </p>
             <img src="/style/home/img/pic-07.jpg" id="icon"> </div>
             <input id="presellflag" type="hidden" value="false">
        </div>


<div class="box-c">
    <p class="c-p">发票信息&nbsp;<span style="font-family: '微软雅黑';font-size: 12px;line-height: 50px;color: red">(发票内容只能开明细)</span>：</p>

    <div style="border:none;" class="box-ax">
        <input type="hidden" id="invoice_header" value="">
                发票类型：<span id="invoice_type">电子发票</span>
                开票方式：<span id="invoice_way">电子发票</span>
    </div>

</div>

<div class="box-d" id="box-d" style="display:none"></div>

<div class="box-02" id="productList">
    <div class="box-tl"><p><a href="/car" latag="latag_pc_ordersubmit_backtocart">返回购物车修改&gt;</a>确认商品</p>
</div>
<div class="box-ls" style="margin-bottom: -20px;">
    <p class="tl-a">&nbsp;</p><p class="tl-b">商品名称</p>
    <p class="tl-c">单价</p><p class="tl-d">数量</p>
    <p class="tl-e">金额</p>
</div>
<div class="divide" style="margin-top: 20px;border-bottom: 1px solid #d9d8d6;">
</div>
<?php
    $tot=0;
 ?>
@foreach($newShop as $shop)
<div class="list" id="52771" style="border-bottom: none;">
    <input type="hidden" name="ids[]" value="{{$shop['id']}}" id="">
    <input type="hidden" name="nums[]" value="{{$shop['num']}}" id="">
    <input type="hidden" name="prices[]" value="{{$shop['goodsInfo']['price']}}" id="">

    <p class="list-a">
        <a title="{{$shop['goodsInfo']['goodsname']}}" href="/goods/{{$shop['id']}}">
            <img title="{{$shop['goodsInfo']['goodsname']}}" width="110px" src="{{$shop['goodsInfo']['img']}}">
        </a>
    </p>
    <p class="list-b">
        <a title="{{$shop['goodsInfo']['goodsname']}}" href="/goods/{{$shop['id']}}">{{$shop['goodsInfo']['goodsname']}}</a>
    </p>
    <p class="list-c">{{$shop['goodsInfo']['price']}}</p>
    <p class="list-d">{{$shop['num']}}</p>
    <?php

        $money=$shop['goodsInfo']['price']*$shop['num'];

        $tot+=$money;
     ?>
    <p class="list-e">{{$money}}</p>
</div>
@endforeach



    <div class="box-03" id="discount" style="display:block">


    <div class="box-06 clearfix" id="discountinfo" style="display: block;">
    <p><span>商品总价：<em style="color: #e2231a;font-weight: bold;font-style: normal;" id="totalPrice">￥{{$tot}}</em>元</span></p>

    <p id="submitbutton" onclick=" return submitbutton()" style="margin-bottom: 15px;"><button style="font-size: 18px;cursor: pointer;margin-top: 2px;">提交订单</button></p>
</div>

</form>


        <div style="display:none" id="addAddr" class="box-SH box">
         <input type="hidden" id="flag1-SH" value="0">
         <input type="hidden" id="deliveridupdate-SH" value="">
         <a class="close"  onclick="closes()" href="javascript:void(0);" >╳</a>
         <ul>

<form action="/caraddr" method="post">
            {{csrf_field()}}
           <li>
              <label><span>*</span>收货人：</label>
              <input type="text" id="name-SH">
              <label name="sname" id="alertName-SH" style="display:none;color:red">收货人不能为空</label>
            </li>
            <li>
              <label>
                <span>*</span>手机：</label>
              <input name="stel" type="text" id="mobile-SH">
            </li>
            <li>
               <label> <span>*</span>地址：</label>
            <select id="Province" runat="server" name="province" style="width: 90px" ></select>
            <select id="Country" runat="server" name="country" style="width: 90px"></select>
            <select id="Town" runat="server" name="town" style="width: 90px"></select>

                <script language="javascript">
                setup();
                </script>
            </li>
            <li>
              <label>
                <span>*</span>详细地址：</label>
              <input name="addrInfo" type="text" style="width:410px;" id="goodsStreet-SH">
            </li>
            <li>
              <label>邮箱：</label>
              <input name="email" type="text" id="mail-SH">
              <span style="color:red;vertical-align: middle;padding-left: 5px;">用来接收订单提醒邮件，便于您及时了解订单状态</span>

            </li>
            <input type="submit" value="保存收货地址" />
        </form>
    </ul>
    </div>

<div id="orderformDiv"></div>

</div>
 <div class="footer">
   <img src="/style/home/img/99999.png" alt="">

   <img src="/style/home/img/9999.png" alt="">
 </div>
</body>

<script>
            function opens(){
                $("#addAddr").show();
            }

            function closes(){
                $("#addAddr").hide();

            }
            function submitbutton(){
               // var a=$("radio").val(); 
               var a=$(".aid").val(); 
                if(a==null){
                   alert("请添加收货地址!");
                return false; 
              }
            }
        </script>
</html>